/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 用户登录 POST /login */
export async function loginUserLogin({
  body,
  options,
}: {
  body: API.PasswordLoginModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelLoginModel_>('/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 忘记密码 POST /login/ignore */
export async function loginIgnore({
  body,
  options,
}: {
  body: API.UserSMSPwdModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/login/ignore', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 请求短信 POST /login/sms */
export async function loginSms({
  body,
  options,
}: {
  body: API.UserSMSModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/login/sms', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
